﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public static class DataTypesHelper
	 {
		  /// <summary>
		  /// The data types
		  /// </summary>
		  private static DataTable dataTypes = new DataTable("DataTypes");

		  /// <summary>
		  /// Gets the data types.
		  /// </summary>
		  /// <value>
		  /// The data types.
		  /// </value>
		  public static DataTable DataTypes
		  {
				get { return dataTypes; }
		  }

		  /// <summary>
		  /// Gets the data types.
		  /// </summary>
		  public static void GetDataTypes()
		  {
				dataTypes.Clear();
				dataTypes = Utility.DBConnection.GetSchema("DataTypes");

				//Utility.PrintDatatable(dataTypes);
		  }

		  /// <summary>
		  /// Writes the data types.
		  /// </summary>
		  public static void WriteDataTypes()
		  {
				string xmlfile = dataTypes.TableName + ".xml";
				string xslFile = dataTypes.TableName + ".xsl";
				string htmFile = dataTypes.TableName + ".htm";

				Utility.WriteXML(dataTypes, dataTypes.TableName + ".xml");
				Utility.WriteHTML(xmlfile, xslFile, htmFile);
		  }
	 }
}